package sv.gob.mh.dgii.dao.terceros;
/**
 * <b>Created by </b>Mirdey
 * <b>for</b>jsiit
 * <b>on</b> 26/03/2012 10:17:57 AM
 * <b>Purpose</b> 
 * <p>
 * </p>
 */

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import sv.gob.mh.dgii.dao.hibernate.HibernateDaoImpl;
import sv.gob.mh.dgii.exceptions.SiitDaoException;
import sv.gob.mh.dgii.model.DeTercero;
/**MIGRADO AL SIIT v3 by </b>Mirdey
 * <b>on</b> 10/09/2012 10:00:00 AM**/

@Repository
@Transactional
public class DeTerceroDaoImpl extends HibernateDaoImpl implements DeTerceroDao{
    private DeTerceroDao tercerodao;                
    public DeTerceroDaoImpl() {
            super(DeTercero.class); 
    }

    @Override
    public List<DeTercero> getDeTercero(String nit) {
        //-- * Consulta HQL * ---
        Query q = getSessionFactory().getCurrentSession().createQuery("SELECT o FROM DeTercero o WHERE o.bActivo=1 AND o.nitTitular=:Nit");         
        q.setParameter("Nit", nit);
        return q.list();
    }                
}